"""
    create by IAmFiveHigh on 2023/9/6
"""

from link_list import LinkList


class LinkListStack:
    def __init__(self):
        self._link_list = LinkList()

    def get_size(self):
        return self._link_list.get_size()

    def is_empty(self):
        return self._link_list.is_empty()

    def push(self, element):
        self._link_list.add_first(element)

    def pop(self):
        return self._link_list.remove_first()

    def peek(self):
        return self._link_list.get_first()

    def __str__(self):
        description = "Stack: top "
        description += str(self._link_list)
        return description
